---
id: use-window-dimensions
title: useWindowDimensions
---

`useWindowDimensions` automatically updates width and height values when screen size changes.

### TypeScript

```typescript
const useWindowDimensions: () => ReactNative.ScaledSize
```

### ReScript

```typescript
let useWindowDimensions: unit => ReactNative.Dimensions.displayMetrics
```

### Example

```jsx live showCode
const App = () => {
  const dimensions = useWindowDimensions()

  return (
    <Typography variant="body">{JSON.stringify(dimensions)}</Typography>
  )
}

render(<App />)
```
